<?php
/**
 * Core_Model_Databasevalidation
 *
 * @author Adrian Stolarski
 */
class Core_Model_Databasevalidation implements Core_Model_Renderable, Core_Model_Classinitialisable{
    
    public $database;
    
    public function render($file_name) {
        if(strtolower($file_name) == 'null'){
            $file_name = 'NULL, ';
        }
        elseif(strtolower($file_name) == 'now()'){
            $file_name .= "NOW(), ";
        }
        else {
            $this->database = new Core_Driver_MysqlImproved;
            $file_name ="'".$this->database->escape($file_name)."'";
        }
        return $file_name;
    }

    public function class_init($class_name) {
        $this->database = new Core_Driver_MysqlImproved;
        $class_name ="'".$this->database->escape($class_name)."'";
        return $class_name;
    }

}
